//Wrapper for EE::MeshLod
#pragma once
#include "stdafx.h"

namespace EsenthelNet
{
	///<summary>Level of Detail, set of Mesh Part's</summary>
	public ref class MeshLod {
	internal:
		MeshLod(EE::MeshLod l) {
			lod = &l;
		}
		EE::MeshLod* lod;
	public:
		MeshLod() { lod = new EE::MeshLod(); }
		~MeshLod() { lod->del(); delete lod; }

		///<summary>Get List of Parts</summary>
		property System::Collections::Generic::List<EsenthelNet::MeshPart^>^ Parts {
			System::Collections::Generic::List<EsenthelNet::MeshPart^>^ get() {
				System::Collections::Generic::List<EsenthelNet::MeshPart^>^ output = gcnew System::Collections::Generic::List<EsenthelNet::MeshPart^>();
				EE::List<EE::MeshPart> p;

				int elms = lod->parts();
				p.setData(lod->part(), elms);

				for(int i = 0; i < elms; i++) {
					output->Add(gcnew EsenthelNet::MeshPart(p.elmToData(i)));
				}
				p.del();
				
				return output;
			}
		}

	};
}